home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Learn Microsoft Visual Basic 6.0 Now
/
Learn Microsoft Visual Basic 6.0 Now (Microsoft Press)(X03-58607)(1998).ISO
/
media
/
chap04
/
b04d015.cc2
< prev
next >
Wrap
Text File
|
1998-06-07
|
1KB
|
28 lines
0, Your assignment in Lab 4 is to create a
3, Magic Number program that calculates a
6, surprise "mystery" value when you enter
8, your age and the year of your birth. In
11, addition to having fun with numbers, this
14, exercise will also help you practice
16, using variables and numeric operators in
18, calculations. You'll also be able to
20, experiment with using Visual Basic's order
23, of precedence rules. To compute the
26, correct result, your program should have a
28, descriptive label, a text box object, a
33, Compute button, and a Quit button. The
38, computation work should be accomplished by
40, the Compute button's Click event
42, procedure. When you run the program, the
46, utility appears in a window. Click the Compute
49, button and enter the year that you were
51, born. Click OK in the dialog box to
57, continue, and enter your current age. Don't
61, be shy now. The calculation results are
65, displayed by a MsgBox function. The
68, magic number has been censored here to keep
70, you guessing. When you click OK, the
73, number also appears on the form. To end
77, the program, click the Quit button. Gosh,
81, what is that magic number anyway?
84, END